package com.yuyou.tas.lesson.service;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.yuyou.tas.service.api.lesson.dto.LessonClassStudentPageDTO;
import com.yuyou.tas.service.api.lesson.dto.StudentDetailDTO;
import com.yuyou.tas.service.api.lesson.dto.StudentPageDTO;
import com.yuyou.tas.service.api.lesson.entity.Student;
import com.yuyou.tas.util.bean.Pagination;
import com.yuyou.tas.util.bean.ResBoolSimpleInfo;

public interface IStudentService {
    int deleteByPrimaryKey(Long id);

    int insert(Student record);

    Student selectByPrimaryKey(Long id);
    
    /**
     * 根据手机和名字查询
     * @param name
     * @param phoneNo
     * @return
     */
    List<Student> selectByName7Phone(String name,String phoneNo);

    /**
     * 根据oId查询
     * @param oId
     * @return
     */
    List<Student> findByOId(Long oId);
    
    int updateByPrimaryKeySelective(Student record);
    
    /**
     * 班级学生分页
     * @param queryPgn
     * @return
     */
    int findLessonClassStudentCount(Pagination<LessonClassStudentPageDTO> queryPgn);
    
    /**
     * 班级学生分页
     * @param queryPgn
     * @return
     */
    List<LessonClassStudentPageDTO> findLessonClassStudentPageList(Pagination<LessonClassStudentPageDTO> queryPgn);
    
    /**
     * 学生分页
     * @param queryPgn
     * @return
     */
    int findStudentCount(Pagination<StudentPageDTO> queryPgn);
    
    /**
     * 学生分页
     * @param queryPgn
     * @return
     */
    List<StudentPageDTO> findStudentPageList(Pagination<StudentPageDTO> queryPgn);
    
    
    /**
     * 外部系统同步学生信息
     * @param list
     * @return
     */
    ResBoolSimpleInfo<String> sycnStudentByOId(List<Student> list);
    
    /**
     * 根据机构ID和Oid找出唯一记录
     * @param oId
     * @param authOrganizationId
     * @return
     */
    Student selectByOrgan7OId(Long oId,Long authOrganizationId);

    /**
     * 根据学生编号找出唯一记录
     * @param studentNo
     * @return
     */
    Student selectByStudentNo(String studentNo);
    
    List<Student> selectByOrganId(Long authOrganizationId);

    Student selectStudentByOrganIdStuNo(Long organId, String stuNo);
    
    /**
     * 查出需要同步学生记录
     * @return
     */
    List<Student> findNeedSycnClassStudent(String startTime);
    
    /**
     * 学生详情
     * @param id
     * @param authOrganizationId
     * @return
     */
    StudentDetailDTO detailStudent(Long id,Long authOrganizationId);
    
    /**
     * 新增学生
     * @param student
     * @return
     */
    ResBoolSimpleInfo<String> addStudent(Student student);
    
    /**
     * 编辑学生
     * @param student
     * @return
     */
    ResBoolSimpleInfo<String> updateStudent(Student student);
    
    /**
     * 绑定班级学生关系
     * @param classId
     * @param StudentIds
     * @return
     */
    ResBoolSimpleInfo<String> bindStudent(Long classId,List<Long> studentIds, Long authOrganizationId,Integer regStatus);

    /**
     * 根据机构id,手机号，姓名查询学生
     * @param authOrganizationId
     * @param phoneNo
     * @param name
     * @return
     */
    Student selectByOrganIdPhoneName(Long authOrganizationId, String phoneNo, String name);
    
}